<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>12.数据代理和数据劫持</title>
        <!-- 引入Vue -->
        <script src="../js/vue.js"></script>
    </head>
    <body>
        <!-- 准备好一个容器-->
        <div id="app">
            <h1>{{uname}}</h1>
            <h1>{{age}}</h1>

            <button @click="changeUname">更新姓名</button>
            <button @click="changeAge">更新年龄</button>

        </div>
    </body>

    <script>
        let vm = new Vue({
            el:"#app",
            data:{
                uname:"张三---法外狂徒",
                age:18
            },
            methods:{
                changeUname(){
                    // console.log(this);
                    this.uname = "罗翔";
                },
                changeAge(){
                    this.age = 40;
                }
            }
        })

        console.log(vm)
    </script>
</html>